package io.kiki.stack.http.feign.vertx.testcase;

import feign.Headers;
import feign.Param;
import feign.RequestLine;
import io.kiki.stack.http.feign.vertx.testcase.domain.Bill;
import io.kiki.stack.http.feign.vertx.testcase.domain.Flavor;
import io.kiki.stack.http.feign.vertx.testcase.domain.IceCreamOrder;
import io.kiki.stack.http.feign.vertx.testcase.domain.Mixin;
import io.vertx.core.Future;

import java.util.Collection;

/**
 * API of an iceream web service.
 *
 * @author Alexei KLENIN
 */
@Headers({"Accept: application/json"})
public interface IcecreamServiceApi {

    @RequestLine("GET /icecream/flavors")
    Future<Collection<Flavor>> getAvailableFlavors();

    @RequestLine("GET /icecream/mixins")
    Future<Collection<Mixin>> getAvailableMixins();

    @RequestLine("POST /icecream/orders")
    @Headers("Content-Type: application/json")
    Future<Bill> makeOrder(IceCreamOrder order);

    @RequestLine("GET /icecream/orders/{orderId}")
    Future<IceCreamOrder> findOrder(@Param("orderId") int orderId);

    @RequestLine("POST /icecream/bills/pay")
    @Headers("Content-Type: application/json")
    Future<Void> payBill(Bill bill);
}
